package com.yunxin.admin.system.infra.persistence.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yunxin.admin.system.infra.persistence.entity.SysUserMerchantDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 用户商户持久层
 *
 * @author zero°
 * @since 2023-06-01
 */
@Mapper
@DS("admin")
public interface SysUserMerchantMapper extends BaseMapper<SysUserMerchantDO> {

    /**
     * 根据用户id获取商户id集合
     * @param userId userId
     * @return 商户id集合
     */
    List<Long> listMerchantIdsByUserId(@Param("userId") Long userId);

//    SysUserMerchantDO testExprot(@Param("isView") Integer isView);


    /**
     *查询当前商户下的用户集合(只查询开启状态)
     * @param userId
     * @return
     */
    List<Long> getMerchantUserIds(@Param("userId") Long userId);

    List<Long>  getUserListByMerchantId(@Param("merchantId")Long merchantId,@Param("roleCodeList") List<String> roleCodeList,@Param("teamId")Integer teamId);
}
